package se.sics.kompics.tutorial.tutorial3;

import se.sics.kompics.launch.Scenario;
import se.sics.kompics.launch.Topology;

public final class ExecurtorRIWCM {
	
	@SuppressWarnings("unused")
	public static void main(String[] args) {
		
		Topology topology = new Topology()
		{
			private static final long serialVersionUID = -105891679883815943L;

			{
				node(1, "127.0.0.1", 22031);
				node(2, "127.0.0.1", 22032);
				node(3, "127.0.0.1", 22033);
				defaultLinks(1000, 0);
			}
		};
		
		Topology topologyEx3 = new Topology(){

			private static final long serialVersionUID = 6001991310903019972L;

			{
				node(1, "127.0.0.1", 22031);
				node(2, "127.0.0.1", 22032);
				node(3, "127.0.0.1", 22033);

				link(1, 2, 1000, 0).bidirectional();
				link(1, 3, 2000, 0).bidirectional();
				link(2, 3, 1750, 0).bidirectional();
			}
		};

		Topology topologyEx41 = new Topology(){

			private static final long serialVersionUID = -8052988279517258053L;

			{
				node(1, "127.0.0.1", 22031);
				node(2, "127.0.0.1", 22032);
				node(3, "127.0.0.1", 22033);

				link(1, 2, 1000, 0).bidirectional();
				link(1, 3, 2000, 0).bidirectional();
				link(2, 3, 1750, 0).bidirectional();
			}
		};

		Topology topologyEx42 = new Topology(){

			private static final long serialVersionUID = -1339649727021983760L;

			{
				node(1, "127.0.0.1", 22031);
				node(2, "127.0.0.1", 22032);
				node(3, "127.0.0.1", 22033);

				link(1, 2, 2000, 0).bidirectional();
				link(1, 3, 2000, 0).bidirectional();
				link(2, 3, 1750, 0).bidirectional();
			}
		};
		
		
		Scenario scenario1 = new Scenario(MainRIWCM.class) {
			{
				command(1, "D30000");
				command(2, "D500:W4R0:D25000");
				command(3, "D10000:R0");
			}
		};
		
		Scenario scenario2 = new Scenario(MainRIWCM.class){
			{
				command(1, "D500:W5R0:R0:D5000:R0:D30000");
				command(2, "D500:W6R0:R0:D5000:R0:D30000");
				command(3, "D500:R0:D500:R0:D10000", 42000);
			}
		};
		
		Scenario scenario123 = new Scenario(MainRIWCM.class) {
			{
				command(1, "D500:W1R0:R0:D500:R0:D8000");
				command(2, "D500:W2R0:R0:D500:R0:D8000", 100);
				command(3, "D500:W3R0:R0:D500:R0:D8000", 200);
			}
		};
		
		Scenario scenario132 = new Scenario(MainRIWCM.class) {
			{
				command(1, "D500:W1R0:R0:D500:R0:D8000");
				command(2, "D500:W2R0:R0:D500:R0:D8000", 200);
				command(3, "D500:W3R0:R0:D500:R0:D8000", 100);
			}
		};
		
		Scenario scenario213 = new Scenario(MainRIWCM.class) {
			{
				command(1, "D500:W1R0:R0:D500:R0:D8000", 100);
				command(2, "D500:W2R0:R0:D500:R0:D8000");
				command(3, "D500:W3R0:R0:D500:R0:D8000", 200);
			}
		};
		
		Scenario scenario231 = new Scenario(MainRIWCM.class) {
			{
				command(1, "D500:W1R0:R0:D500:R0:D8000", 200);
				command(2, "D500:W2R0:R0:D500:R0:D8000");
				command(3, "D500:W3R0:R0:D500:R0:D8000", 100);
			}
		};
		
		Scenario scenario312 = new Scenario(MainRIWCM.class) {
			{
				command(1, "D500:W1R0:R0:D500:R0:D8000", 100);
				command(2, "D500:W2R0:R0:D500:R0:D8000", 200);
				command(3, "D500:W3R0:R0:D500:R0:D8000");
			}
		};
		
		Scenario scenario321 = new Scenario(MainRIWCM.class) {
			{
				command(1, "D500:W1R0:R0:D500:R0:D8000", 200);
				command(2, "D500:W2R0:R0:D500:R0:D8000", 100);
				command(3, "D500:W3R0:R0:D500:R0:D8000");
			}
		};
		
		Scenario scenario4 = new Scenario(MainRIWCM.class) {
			{
				command(1, "D500:W1R0:R0:D500:R0:D8000");
				command(2, "D500:W2R0:R0:D500:R0:D8000", 100);
				command(3, "D500:W3R0:R0:D500:R0:D8000", 200);
			}
		};
		
		Scenario scenario41 = new Scenario(MainRIWCM.class) {
			{
				command(1, "D500:W1R0:R0:D500:R0:D8000");
				command(2, "D4000:W2R0:R0:D500:R0:D8000", 100);
				command(3, "D3500:W3R0:R0:D500:R0:D8000", 200);
			}
		};

		
//		scenario1.executeOn(topology);
//		scenario2.executeOn(topology);
//		scenario123.executeOn(topologyEx3);	
//		scenario132.executeOn(topologyEx3);
//		scenario213.executeOn(topologyEx3);
//		scenario231.executeOn(topologyEx3);
//		scenario312.executeOn(topologyEx3);
//		scenario321.executeOn(topologyEx3);
		

		scenario4.executeOn(topologyEx41);
//		scenario4.executeOn(topologyEx42);
//		scenario41.executeOn(topologyEx41);
		
	}

}
